Dynomotion

Group: DynoMotion Message: 6364 From: fireup_kev Date: 1/1/2013
Subject: Re: "SetMcodeAction" don't work for M100 to M119
It works for me also if I use M_Action_Setbit, but if I use M_Action_Callback, it will call the callback and then call InterpreterComplete and end the program even though it's not the end of the program.

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Kevin,
>
> It seems to work fine for me using the Dynomotion VB.NET Example in V4.30j:
>
> I configured M100 and M101 actions to toggle Bit 46 (KFLOP LED0) on and off with:
>
>     Public Sub Run()
>
>         _Controller.CoordMotion.Interpreter.SetMcodeAction(21, KMotion_dotNet.MCODE_TYPE.M_Action_Setbit, 46, 1, 0, 0, 0, "")
>         _Controller.CoordMotion.Interpreter.SetMcodeAction(22, KMotion_dotNet.MCODE_TYPE.M_Action_Setbit, 46, 0, 0, 0, 0, "")
>
>         _InterpreterStatus = ""
>         If System.IO.File.Exists(_InterpreterFileName) = True Then
>             _Controller.CoordMotion.Interpreter.Interpret(_InterpreterFileName)
>         End If
>
>
>
> Then ran GCode of:
>
> G0 X0 Y0 Z0
> F40
> M100
> G1 X0 Y1
> M101
> G1 X0 Y0
> M100
> G1 X1 Y0
> M101
> G1 X0 Y0
> M2
>
>
> And the KFLOP LED toggles on and off
>
> Regards
> TK
>
>
>
>
>
> ________________________________
> From: fireup_kev <kliboon@...>
> To: DynoMotion@yahoogroups.com
> Sent: Sunday, December 30, 2012 12:10 PM
> Subject: [DynoMotion] Re: "SetMcodeAction" don't work for M100 = M119
>
>
>  
> I tried using SetMcodeAction(21, ... for M100 with no effect.
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi Kevin,
> >
> > I'm not sure how you are using it but the "MCode Action" number is not the same as the MCode number.  All the MCodes 0-10, the 10 user button actions, and the 20 M100-119 actions are all packed into an array of  41 actions.
> >
> > M100 is the 21st Action not the 100th.  Here is the related constants from GCodeInterpreter.h.  We should export them to C#
> >
> > #define MAX_MCODE_ACTIONS_M1 11        // actually only 2-10 are used
> > #define MAX_MCODE_ACTIONS_BUTTONS 10
> > #define MAX_MCODE_ACTIONS_M100 20
> > #define MAX_MCODE_ACTIONS (MAX_MCODE_ACTIONS_M1+MAX_MCODE_ACTIONS_M100+MAX_MCODE_ACTIONS_BUTTONS)
> > #define MAX_MCODE_DOUBLE_PARAMS 5
> > #define MCODE_ACTIONS_M100_OFFSET (MAX_MCODE_ACTIONS_M1+MAX_MCODE_ACTIONS_BUTTONS)
> >
> >
> > HTH
> > Regards
> > TK
> >
> >
> >
> > ________________________________
> > From: fireup_kev <kliboon@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Saturday, December 29, 2012 11:50 PM
> > Subject: [DynoMotion] "SetMcodeAction" don't work for M100 = M119
> >
> >
> >  
> > "CoordMotion.Interpreter.SetMcodeAction" for .NET don't seem to work for M100 to M119 (unless I'm using it wrong)
> >
> > Thanks,
> > Kevin
> >
>
Group: DynoMotion Message: 6365 From: Tom Kerekes Date: 1/1/2013
Subject: Re: "SetMcodeAction" don't work for M100 to M119
Hi Kevin,

What are you returning in your callback function?  Any non-zero value should cause the interpreter to abort (and call InterpreterComplete).

If you want the Interpreter to continue you must return zero.

Regards
TK


Group: DynoMotion Message: 6374 From: fireup_kev Date: 1/1/2013
Subject: Re: "SetMcodeAction" don't work for M100 to M119
The Callback function for InterpreterUserMCodeCallbackRequested returns a void so I can't return anything. It works fine for M3 to M9 but not M100 to M119.

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Kevin,
>
> What are you returning in your callback function?  Any non-zero value should cause the interpreter to abort (and call InterpreterComplete).
>
> If you want the Interpreter to continue you must return zero.
>
> Regards
> TK
>
>
>
>
> ________________________________
> From: fireup_kev <kliboon@...>
> To: DynoMotion@yahoogroups.com
> Sent: Tuesday, January 1, 2013 1:34 PM
> Subject: [DynoMotion] Re: "SetMcodeAction" don't work for M100 to M119
>
>
>  
> It works for me also if I use M_Action_Setbit, but if I use M_Action_Callback, it will call the callback and then call InterpreterComplete and end the program even though it's not the end of the program.
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi Kevin,
> >
> > It seems to work fine for me using the Dynomotion VB.NET Example in V4.30j:
> >
> > I configured M100 and M101 actions to toggle Bit 46 (KFLOP LED0) on and off with:
> >
> >     Public Sub Run()
> >
> >         _Controller.CoordMotion.Interpreter.SetMcodeAction(21, KMotion_dotNet.MCODE_TYPE.M_Action_Setbit, 46, 1, 0, 0, 0, "")
> >         _Controller.CoordMotion.Interpreter.SetMcodeAction(22, KMotion_dotNet.MCODE_TYPE.M_Action_Setbit, 46, 0, 0, 0, 0, "")
> >
> >         _InterpreterStatus = ""
> >         If System.IO.File.Exists(_InterpreterFileName) = True Then
> >             _Controller.CoordMotion.Interpreter.Interpret(_InterpreterFileName)
> >         End If
> >
> >
> >
> > Then ran GCode of:
> >
> > G0 X0 Y0 Z0
> > F40
> > M100
> > G1 X0 Y1
> > M101
> > G1 X0 Y0
> > M100
> > G1 X1 Y0
> > M101
> > G1 X0 Y0
> > M2
> >
> >
> > And the KFLOP LED toggles on and off
> >
> > Regards
> > TK
> >
> >
> >
> >
> >
> > ________________________________
> > From: fireup_kev <kliboon@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Sunday, December 30, 2012 12:10 PM
> > Subject: [DynoMotion] Re: "SetMcodeAction" don't work for M100 = M119
> >
> >
> >  
> > I tried using SetMcodeAction(21, ... for M100 with no effect.
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > > Hi Kevin,
> > >
> > > I'm not sure how you are using it but the "MCode Action" number is not the same as the MCode number.  All the MCodes 0-10, the 10 user button actions, and the 20 M100-119 actions are all packed into an array of  41 actions.
> > >
> > > M100 is the 21st Action not the 100th.  Here is the related constants from GCodeInterpreter.h.  We should export them to C#
> > >
> > > #define MAX_MCODE_ACTIONS_M1 11        // actually only 2-10 are used
> > > #define MAX_MCODE_ACTIONS_BUTTONS 10
> > > #define MAX_MCODE_ACTIONS_M100 20
> > > #define MAX_MCODE_ACTIONS (MAX_MCODE_ACTIONS_M1+MAX_MCODE_ACTIONS_M100+MAX_MCODE_ACTIONS_BUTTONS)
> > > #define MAX_MCODE_DOUBLE_PARAMS 5
> > > #define MCODE_ACTIONS_M100_OFFSET (MAX_MCODE_ACTIONS_M1+MAX_MCODE_ACTIONS_BUTTONS)
> > >
> > >
> > > HTH
> > > Regards
> > > TK
> > >
> > >
> > >
> > > ________________________________
> > > From: fireup_kev <kliboon@>
> > > To: DynoMotion@yahoogroups.com
> > > Sent: Saturday, December 29, 2012 11:50 PM
> > > Subject: [DynoMotion] "SetMcodeAction" don't work for M100 = M119
> > >
> > >
> > >  
> > > "CoordMotion.Interpreter.SetMcodeAction" for .NET don't seem to work for M100 to M119 (unless I'm using it wrong)
> > >
> > > Thanks,
> > > Kevin
> > >
> >
>
Group: DynoMotion Message: 6377 From: Tom Kerekes Date: 1/1/2013
Subject: Re: "SetMcodeAction" don't work for M100 to M119
Hi Kevin,

You are correct.  That is a bug.  Please try substituting the attached two files and returning a 0.

I guess it was just luck that the undefined return value for the lower M Codes was zero for some reason.

Regards
TK

Group: DynoMotion Message: 6378 From: fireup_kev Date: 1/1/2013
Subject: Re: "SetMcodeAction" don't work for M100 to M119
That seems to fixed it, Thanks.

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Kevin,
>
> You are correct.  That is a bug.  Please try substituting the attached two files and returning a 0.
>
> I guess it was just luck that the undefined return value for the lower M Codes was zero for some reason.
>
> Regards
> TK
>
>
>
> ________________________________
> From: fireup_kev <kliboon@...>
> To: DynoMotion@yahoogroups.com
> Sent: Tuesday, January 1, 2013 7:16 PM
> Subject: [DynoMotion] Re: "SetMcodeAction" don't work for M100 to M119
>
>
>  
> The Callback function for InterpreterUserMCodeCallbackRequested returns a void so I can't return anything. It works fine for M3 to M9 but not M100 to M119.
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi Kevin,
> >
> > What are you returning in your callback function?  Any non-zero value should cause the interpreter to abort (and call InterpreterComplete).
> >
> > If you want the Interpreter to continue you must return zero.
> >
> > Regards
> > TK
> >
> >
> >
> >
> > ________________________________
> > From: fireup_kev <kliboon@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Tuesday, January 1, 2013 1:34 PM
> > Subject: [DynoMotion] Re: "SetMcodeAction" don't work for M100 to M119
> >
> >
> >  
> > It works for me also if I use M_Action_Setbit, but if I use M_Action_Callback, it will call the callback and then call InterpreterComplete and end the program even though it's not the end of the program.
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > >
> > > Hi Kevin,
> > >
> > > It seems to work fine for me using the Dynomotion VB.NET Example in V4.30j:
> > >
> > > I configured M100 and M101 actions to toggle Bit 46 (KFLOP LED0) on and off with:
> > >
> > >     Public Sub Run()
> > >
> > >         _Controller.CoordMotion.Interpreter.SetMcodeAction(21, KMotion_dotNet.MCODE_TYPE.M_Action_Setbit, 46, 1, 0, 0, 0, "")
> > >         _Controller.CoordMotion.Interpreter.SetMcodeAction(22, KMotion_dotNet.MCODE_TYPE.M_Action_Setbit, 46, 0, 0, 0, 0, "")
> > >
> > >         _InterpreterStatus = ""
> > >         If System.IO.File.Exists(_InterpreterFileName) = True Then
> > >             _Controller.CoordMotion.Interpreter.Interpret(_InterpreterFileName)
> > >         End If
> > >
> > >
> > >
> > > Then ran GCode of:
> > >
> > > G0 X0 Y0 Z0
> > > F40
> > > M100
> > > G1 X0 Y1
> > > M101
> > > G1 X0 Y0
> > > M100
> > > G1 X1 Y0
> > > M101
> > > G1 X0 Y0
> > > M2
> > >
> > >
> > > And the KFLOP LED toggles on and off
> > >
> > > Regards
> > > TK
> > >
> > >
> > >
> > >
> > >
> > > ________________________________
> > > From: fireup_kev <kliboon@>
> > > To: DynoMotion@yahoogroups.com
> > > Sent: Sunday, December 30, 2012 12:10 PM
> > > Subject: [DynoMotion] Re: "SetMcodeAction" don't work for M100 = M119
> > >
> > >
> > >  
> > > I tried using SetMcodeAction(21, ... for M100 with no effect.
> > >
> > > --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> > > >
> > > > Hi Kevin,
> > > >
> > > > I'm not sure how you are using it but the "MCode Action" number is not the same as the MCode number.ÃÆ'‚  All the MCodes 0-10, the 10 user button actions, and the 20 M100-119 actions are all packed into an array ofÃÆ'‚  41 actions.
> > > >
> > > > M100 is the 21st Action not the 100th.ÃÆ'‚  Here is the related constants from GCodeInterpreter.h.ÃÆ'‚  We should export them to C#
> > > >
> > > > #define MAX_MCODE_ACTIONS_M1 11ÃÆ'‚ ÃÆ'‚ ÃÆ'‚ ÃÆ'‚ ÃÆ'‚ ÃÆ'‚ ÃÆ'‚  // actually only 2-10 are used
> > > > #define MAX_MCODE_ACTIONS_BUTTONS 10
> > > > #define MAX_MCODE_ACTIONS_M100 20
> > > > #define MAX_MCODE_ACTIONS (MAX_MCODE_ACTIONS_M1+MAX_MCODE_ACTIONS_M100+MAX_MCODE_ACTIONS_BUTTONS)
> > > > #define MAX_MCODE_DOUBLE_PARAMS 5
> > > > #define MCODE_ACTIONS_M100_OFFSET (MAX_MCODE_ACTIONS_M1+MAX_MCODE_ACTIONS_BUTTONS)
> > > >
> > > >
> > > > HTH
> > > > Regards
> > > > TK
> > > >
> > > >
> > > >
> > > > ________________________________
> > > > From: fireup_kev <kliboon@>
> > > > To: DynoMotion@yahoogroups.com
> > > > Sent: Saturday, December 29, 2012 11:50 PM
> > > > Subject: [DynoMotion] "SetMcodeAction" don't work for M100 = M119
> > > >
> > > >
> > > > ÃÆ'‚ 
> > > > "CoordMotion.Interpreter.SetMcodeAction" for .NET don't seem to work for M100 to M119 (unless I'm using it wrong)
> > > >
> > > > Thanks,
> > > > Kevin
> > > >
> > >
> >
>